<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var years = Number(prompt("请输入年"));
        var month = Number(prompt("请输入月"));
        var day = Number(prompt("请输入日"));
        function getdate(years,month,day) {
            var days = day;
            if (month == 1) {
                return days;
            }
            var months = [31,28,31,30,31,30,31,31,30,31,30,31];
            for (var i = 0; i < month - 1; i++) {
                days += months[i];
            }
            if (isRun(years) && month > 2) {
                days++;
            }
            return days;
        }
        function isRun(num) {
            return num % 4 == 0 && num % 100 !=0 || num% 400 ==0;
        }
        document.write("今天是今年的第"+getdate(years,month,day)+"天");
    </script>
</head>
<body>

</body>
</html>